package com;

import java.util.ArrayList;
import java.util.Scanner;

public class delete {
    public static void delete(ArrayList<student> st){
        System.out.println("请输入需要删除的学生的id");
        Scanner sc = new Scanner(System.in);
        String uid = sc.next();
        for (int i = 0; i < st.size(); i++) {
            if(uid.equals(st.get(i).getId()))
            {
                st.remove(i);
                System.out.println("删除成功");
                return;
            }
        }
        System.out.println("删除的用户不存在");

    }
}
